package com.ruoyi.system.service.news.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.github.pagehelper.PageHelper;
import com.ruoyi.system.domain.news.NewsSystemInfo;
import com.ruoyi.system.domain.news.query.NewsSystemInfoQuery;
import com.ruoyi.system.domain.news.vo.NewsSystemInfoVo;
import com.ruoyi.system.mapper.news.NewsSystemInfoMapper;
import com.ruoyi.system.service.news.NewsSystemInfoService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
@Slf4j
public class NewsSystemInfoServiceImpl extends ServiceImpl<NewsSystemInfoMapper, NewsSystemInfo>
        implements NewsSystemInfoService {

    @Override
//    @DataScope(deptAlias = "t",userAlias = "t")
    public List<NewsSystemInfoVo> getNewsSystemInfoList(NewsSystemInfoQuery newsSystemInfoQuery) {
        if (newsSystemInfoQuery.getIfPage()) {
            PageHelper.startPage(newsSystemInfoQuery.getPageNum(), newsSystemInfoQuery.getPageSize());
        }
        return baseMapper.getNewsSystemInfoList(newsSystemInfoQuery);
    }
}
